package com.fjrz.bbxwj.mode.vm

import android.app.Application
import androidx.lifecycle.MutableLiveData
import com.fjrz.bbxwj.entity.CommonProtocolResponse
import com.fjrz.bbxwj.entity.FeedbackTypeResponse
import com.fjrz.bbxwj.entity.UserMeResponse
import com.fjrz.bbxwj.mode.api.commonData
import com.fjrz.bbxwj.mode.api.commonText
import com.fjrz.bbxwj.mode.api.feedbackSubmit
import com.fjrz.bbxwj.mode.api.feedbackTypeList
import com.module.lemlin.base.BaseViewModel
import com.module.lemlin.mode.ViewModelSubscribe
import com.module.lemlin.rxhttp.HttpServiceData
import com.module.lemlin.rxhttp.HttpServiceResponse
import io.reactivex.rxjava3.disposables.Disposable


class FeedbackViewModel(application: Application) : BaseViewModel(application) {


    val feedbackTypeLiveData = MutableLiveData<HttpServiceResponse<FeedbackTypeResponse>>()
    val feedbackSubmitLiveData = MutableLiveData<HttpServiceResponse<HttpServiceData>>()

    /**
     * 反馈类型
     * */
    fun feedbackTypeList() {
        val disposable: Disposable =
            feedbackTypeList(ViewModelSubscribe(feedbackTypeLiveData))
        dispose.add(disposable)
    }

    /**
     * 反馈类型
     * */
    fun feedbackSubmit(typeId: Int, content: String) {
        val disposable: Disposable =
            feedbackSubmit(typeId.toString(), content, ViewModelSubscribe(feedbackSubmitLiveData))
        dispose.add(disposable)
    }
}